﻿#pragma once

#include "Cdmsoft.h"
#include "BASE64_API.h"
#include "LockMutex.h"
#include "Dbgout.h"
#include "GameTask.h"
#include "GameStruct.h"
#include "IniFile.h"
#include "StdioFileEx.h"
#include "SRegedit.h"
#include "AllocateDM.h"
#include "LeiDian.h"
#include "Logic.h"
#include <map>
#include <afxinet.h>
using namespace std;
#define ConfigFile  _T("C://MobileGame//Config.ini")
#define AccountFile _T("C://MobileGame//Account.ini")
#define RoleNameFile _T("C://MobileGame//RoleName.ini") //角色名称记录
#define MoneyFile _T("C://MobileGame//Money.ini") //金币记录
#define TaskSpeedFile _T("C://MobileGame//每日任务进度.ini")
#define ChengHaoStateFile _T("C://MobileGame//成号状态.ini")

extern CLuck g_cLuck;
extern CIniFile g_IniFile;
extern CIniFile g_AccountFile;
extern CIniFile g_RoleNameFile;
extern CIniFile g_MoneyFile;
extern CIniFile g_TaskSpeedFile;
extern CIniFile g_ChangHaoStateFile;//成号状态

extern int m_GNum;//当前运行列表编号
extern bool m_GState;//运行状态
extern int m_GCount;
extern CString m_SimulatorPath;
extern  CString g_Dnplayer2Path;
extern long m_GGameHwnd;
extern Cdmsoft *m_GlobalDM;//全局大漠
extern Cdmsoft *m_OnLineDM;//全局大漠
extern Cdmsoft *m_DM[20];
extern float m_fSim;
extern CString m_SimulatorPath;
extern CString g_Dnplayer2Path;
extern CString g_strDesktopPath;
extern map<CString, OcrDetail>ocrMap;
extern VARIANT intX, intY;
extern ScriptSetupInfo m_ScriptSet[20];
CString NumberToString(LONG Number);

//创建一个目录
BOOL CreateDir(CString P);

//分割字符串
void StringSplit(CString source, CStringArray& dest, char division);

DWORD RandomNumber(DWORD dwNumber1, DWORD dwNumber2);
DWORD WINAPI OnlinCheck(LPVOID lParam);
DWORD WINAPI StartScript(LPVOID lParam);
void KillProcess(CString sExeName);
void OutPutListView(int nIndex, CString str);
bool runScript(CString str);
bool FindCol(OcrDetail ocrDetail);
bool FindMulCol(OcrDetail ocrDetail);
bool CmpCol(OcrDetail ocrDetail);
bool FindPic(OcrDetail ocrDetail);
bool FindStr(OcrDetail ocrDetail);

bool ocrType(OcrDetail ocrDetail);
int SplitVARIANT(CString strSrc, VARIANT* nlist, CString division);

bool Continued(OcrDetail ocrDetail);
bool ContinuedAction(int type, CString str);


bool dmClick(OcrDetail ocrDetail);
bool dmDoubleClick(OcrDetail ocrDetail);
bool dmSlide(OcrDetail ocrDetail);
bool dmContinued(OcrDetail ocrDetail);

bool runScriptList(CString str);

CString GetNetIp();